<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<head>
  <meta charset="UTF-8"/>
  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/>
  <title>定值</title>

  <div th:replace="common :: common_header"></div>
</head>
<body>
<div th:replace="common::#leftmenu"></div>
<div class="main-content">
  <form action="/paras" class="form-inline" method="get">
    <label for="areaNum">通道:</label><select id="areaNum" name="areaNum" class="form-control text-center">
    <option th:each="areaNum:${areaNum}"
            th:text="${areaNum}"
            th:value="${areaNum}"
            th:selected="${#strings.equals(param.areaNum, areaNum)}">
    </option>
  </select>
    <label for="type">定值类型:</label><select id="type" name="type" class="form-control text-center">
    <option th:each="type:${paraType}"
            th:text="${type}"
            th:value="${type}"
            th:selected="${#strings.equals(param.type, type)}">
    </option>
    </select>
    <button type="submit">搜索</button>
  </form>
  <table class="table table-hover table-striped table-bordered table-sm">
    <thead class="text-center">
    <tr>
      <th>序号</th>
      <th>定值名称</th>
      <th>定值类型</th>
      <th>定值值</th>
      <th>范围</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="para,paraState:${pageInfo.list}" class="text-center">
      <td th:text="${paraState.index+(pageInfo.pageNum-1)*pageInfo.pageSize}">id</td>
      <td th:text="${para.name}">名称</td>
      <td th:text="${para.type}">类型</td>
  <!--    <td th:text="${#strings.isEmpty(para.option)?#strings.append(para.value,para.unit):optionList[paraState.index]}">值</td>-->
  <!--    <td th:text="${#strings.isEmpty(para.option)?#strings.append(#strings.append(#strings.append(para.minValue,'~'),para.maxValue),para.unit):#strings.substringBefore(para.option,'、命名列表越限')}"></td>-->
      <td th:text="${valueList[paraState.index]}">value</td>
      <td th:text="${rangeList[paraState.index]}">range</td>
    </tr>
    </tbody>
  </table>
  <div>
    <p>当前第 <span th:text="${pageInfo.pageNum}"></span> 页，总 <span th:text="${pageInfo.pages}"></span> 页，共 <span th:text="${pageInfo.total}"></span> 条记录</p>
    <a th:href="@{/paras(areaNum=${param.areaNum}, type=${param.type}, pageNum=1)}">首页</a>
    <a th:href="@{/paras(areaNum=${param.areaNum}, type=${param.type}, pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">上一页</a>
    <a th:href="@{/paras(areaNum=${param.areaNum}, type=${param.type}, pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">下一页</a>
    <a th:href="@{/paras(areaNum=${param.areaNum}, type=${param.type}, pageNum=${pageInfo.pages})}">尾页</a>
  </div>
</div>
</body>
</html>